package com.example.qa.service.domain;

import com.example.qa.service.common.IdWorker;
import com.example.qa.service.domain.port.GetqaListPort;
import com.example.qa.service.domain.valueobject.Email;
import com.example.qa.service.domain.valueobject.qaAge;
import com.example.qa.service.domain.valueobject.qaId;
import com.example.qa.service.domain.valueobject.qaName;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

@Setter
@Getter
@ToString
public class qa {
    private qaId id;
    private qaName name;
    private qaAge age;
    private Email email;

    public qa() {
    }

    public qa(qaId id, qaName name, qaAge age, Email email) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.email = email;
    }

    public qa( qaName name, qaAge age, Email email) {
        this.id= genId() ;
        this.name = name;
        this.age = age;
        this.email = email;
    }

    public static List<qa> getqas(GetqaListPort getqaListPort){
        return getqaListPort.getqas();
    }

    public qaId genId(){
        return new qaId(new IdWorker().nextId());
    }
}
